<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

Auth::routes();

Route::get('/home', 'HomeController@index')->name('home');

Route::get('/index', 'PageController@index')->name('index');

Route::get('/news', 'PageController@news')->name('news');

Route::get('/pro', 'PageController@pro')->name('pro');

Route::get('/pro/{id}', 'AjaxController@pro')->where('id', '[0-9]+');

Route::get('/pro/item/{id}', 'AjaxController@proItem')->where('id', '[0-9]+');

Route::get('/about', 'PageController@about')->name('about');

Route::get('/index/{id}', 'PageController@index')->where('id', '5');

Route::get('/news/{id}', 'AjaxController@news')->where('id', '[0-9]+');

Route::get('/admin', 'AdminController@admin')->middleware('auth')->name('admin');

Route::post('/admin/upload/wx', 'AjaxController@upload_wx')->middleware('auth')->name('upload_wx');

Route::post('/update/ao', 'AjaxController@update_ao')->middleware('auth')->name('update_ao');

Route::post('/update/us/{id}', 'AjaxController@update_us')->middleware('auth')->name('update_us');

Route::post('/delete/us/{id}', 'AjaxController@delete_us')->middleware('auth')->name('delete_us');

Route::post('/update/avatar', 'AjaxController@upload_avatar')->middleware('auth')->name('update_avatar');

Route::post('/upload/swiper', 'AjaxController@upload_swiper')->middleware('auth')->name('upload_swiper');

Route::get('/get/new/{id}', 'AjaxController@get_new')->middleware('auth')->name('get_new');

Route::post('/update/news', 'AjaxController@update_news')->middleware('auth')->name('update_news');

Route::post('/delete/news', 'AjaxController@delete_news')->middleware('auth')->name('delete_news');

Route::post('/upload/news/show', 'AjaxController@upload_new_show_img')->middleware('auth')->name('upload_new_show_img');

Route::post('/upload/pros/show', 'AjaxController@upload_pro_show_img')->middleware('auth')->name('upload_pro_show_img');

Route::post('/upload/news/content', 'AjaxController@upload_new_content_img')->middleware('auth')->name('upload_new_content_img');

Route::post('/delete/pros', 'AjaxController@delete_pros')->middleware('auth')->name('delete_pros');

Route::get('/get/pro/{id}', 'AjaxController@get_pro')->middleware('auth')->name('get_pro');

Route::post('/update/pro', 'AjaxController@update_pro')->middleware('auth')->name('update_pro');

Route::post('/update/swiper', 'AjaxController@update_swiper')->middleware('auth')->name('update_swiper');
